package com.weather.business.service.impl;

import java.util.List;
import com.weather.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.weather.business.mapper.NmShopMapper;
import com.weather.business.domain.NmShop;
import com.weather.business.service.INmShopService;

/**
 * 商城Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-16
 */
@Service
public class NmShopServiceImpl implements INmShopService 
{
    @Autowired
    private NmShopMapper nmShopMapper;

    /**
     * 查询商城
     * 
     * @param id 商城主键
     * @return 商城
     */
    @Override
    public NmShop selectNmShopById(Long id)
    {
        return nmShopMapper.selectNmShopById(id);
    }

    /**
     * 查询商城列表
     * 
     * @param nmShop 商城
     * @return 商城
     */
    @Override
    public List<NmShop> selectNmShopList(NmShop nmShop)
    {
        return nmShopMapper.selectNmShopList(nmShop);
    }

    /**
     * 新增商城
     * 
     * @param nmShop 商城
     * @return 结果
     */
    @Override
    public int insertNmShop(NmShop nmShop)
    {
        nmShop.setCreateTime(DateUtils.getNowDate());
        return nmShopMapper.insertNmShop(nmShop);
    }

    /**
     * 修改商城
     * 
     * @param nmShop 商城
     * @return 结果
     */
    @Override
    public int updateNmShop(NmShop nmShop)
    {
        nmShop.setUpdateTime(DateUtils.getNowDate());
        return nmShopMapper.updateNmShop(nmShop);
    }

    /**
     * 批量删除商城
     * 
     * @param ids 需要删除的商城主键
     * @return 结果
     */
    @Override
    public int deleteNmShopByIds(Long[] ids)
    {
        return nmShopMapper.deleteNmShopByIds(ids);
    }

    /**
     * 删除商城信息
     * 
     * @param id 商城主键
     * @return 结果
     */
    @Override
    public int deleteNmShopById(Long id)
    {
        return nmShopMapper.deleteNmShopById(id);
    }
}
